Ensure that we always calculate clip regions for root windows
authorAlexander Larsson <alexl@redhat.com>
Thu, 25 Jun 2009 14:59:18 +0000 (16:59 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 25 Jun 2009 15:05:21 +0000 (17:05 +0200)
Without this we can't draw to them, which caused problems for e.g.
gnome-settings-daemon clearing the background when the desktop
background changed.

Note: We don't actually clip away child windows from the root window,
the clip is just based on the size of the root window.

gdk/gdkwindow.c
gdk/x11/gdkevents-x11.c
gdk/x11/gdkwindow-x11.c

index aa10712621c50c78ade60167b4975919c5865d21..c60ca61858a4a3b93d3600248d529c6d839ec1fc 100644 (file)
@@ -774,7 +774,8 @@ recompute_visible_regions_internal (GdkWindowObject *private,
 
       old_clip_region_with_children = private->clip_region_with_children;
       private->clip_region_with_children = gdk_region_copy (private->clip_region);
-      remove_child_area (private, NULL, FALSE, private->clip_region_with_children);
+      if (GDK_WINDOW_TYPE (private) != GDK_WINDOW_ROOT)
+       remove_child_area (private, NULL, FALSE, private->clip_region_with_children);
 
       if (clip_region_changed ||
          !gdk_region_equal (private->clip_region_with_children, old_clip_region_with_children))
@@ -817,8 +818,9 @@ recompute_visible_regions_internal (GdkWindowObject *private,
        }
     }
 
-  /* Update all children, recursively. */
-  if (abs_pos_changed || clip_region_changed || recalculate_children)
+  /* Update all children, recursively (except for root, where children are not exact). */
+  if ((abs_pos_changed || clip_region_changed || recalculate_children) &&
+      GDK_WINDOW_TYPE (private) != GDK_WINDOW_ROOT)
     {
       for (l = private->children; l; l = l->next)
        {
@@ -840,7 +842,9 @@ recompute_visible_regions_internal (GdkWindowObject *private,
        (private->parent != NULL &&
        GDK_WINDOW_TYPE (private->parent) != GDK_WINDOW_ROOT)) &&
       /* or for foreign windows */
-      GDK_WINDOW_TYPE (private) != GDK_WINDOW_FOREIGN
+      GDK_WINDOW_TYPE (private) != GDK_WINDOW_FOREIGN &&
+      /* or for the root window */
+      GDK_WINDOW_TYPE (private) != GDK_WINDOW_ROOT
       )
     {
       GDK_WINDOW_IMPL_GET_IFACE (private->impl)->shape_combine_region ((GdkWindow *)private, private->clip_region, 0, 0);
index 4565b3961b7be4fbe3d243da70af2818eb4505b6..ad5107bdd6b78e2144af35de944f1056c3d99071 100644 (file)
@@ -1835,6 +1835,7 @@ gdk_event_translate (GdkDisplay *display,
          window_private->width = xevent->xconfigure.width;
          window_private->height = xevent->xconfigure.height;
 
+         _gdk_window_update_size (window);
          _gdk_x11_drawable_update_size (window_private->impl);
          _gdk_x11_screen_size_changed (screen, xevent);
         }
index 303b18aa27a89487c160558a10c44be9de1f85ea..9caa17a163a6402a3c542babf83bad00c4f8b0a6 100644 (file)
@@ -450,6 +450,7 @@ _gdk_windowing_window_init (GdkScreen * screen)
   private->abs_y = 0;
   private->width = WidthOfScreen (screen_x11->xscreen);
   private->height = HeightOfScreen (screen_x11->xscreen);
+  _gdk_window_update_size (screen_x11->root_window);
   
   _gdk_xid_table_insert (screen_x11->display,
                         &screen_x11->xroot_window,